/*
 * @Author: sunboylu
 * @Date: 2021-01-11 19:33:44
 * @LastEditors: sunboylu
 * @LastEditTime: 2021-09-27 20:51:31
 * @Description: 
 */

@JS("ZegoExpressEngine")
library ZegoExpressEngine;

import 'dart:html';

import 'package:js/js.dart';

@JS()
class ZegoExpressEngine {
  external ZegoExpressEngine(dynamic appid, String server);
  external loginRoom(String roomid, String token, dynamic options);
  external checkSystemRequirements();
  external createStream();
  external startPublishingStream(String roomID, dynamic localStream);
  external setVideoConfig(dynamic localStream, dynamic constraints);
  external setAudioConfig(dynamic localStream, dynamic constraints);
  external replaceTrack(dynamic localStream, dynamic mediaStreamTrack);
  external setCaptureVolume(dynamic localStream, num volume);
  external setStreamExtraInfo(String streamID, String extraInfo);
  external addPublishCdnUrl(String streamID, String targetURL);
  external removePublishCdnUrl(String streamID, String targetURL);

  external startPlayingStream(String streamID, dynamic playOption);
  external stopPublishingStream(String streamID);
  external destroyStream(MediaStream streamID);
  external stopPlayingStream(String streamID);
  external logoutRoom(String roomID);
  external mutePublishStreamVideo(dynamic localStream, bool boolean);
  external mutePublishStreamAudio(dynamic localStream, bool boolean);
  external mutePlayStreamVideo(String streamID, bool boolean);
  external mutePlayStreamAudio(String streamID, bool boolean);
  external startMixerTask(dynamic mixStreamConfig);
  external stopMixerTask(String taskID);
  external setMixerTaskConfig(dynamic mixStreamConfig);
  external startMixingAudio(String streamID, dynamic mediaList);
  external stopMixingAudio(String streamID, dynamic mediaList);
  external setMixingAudioVolume(String streamID, num volume, dynamic media);
  external enumDevices();
  external useVideoDevice(dynamic localStream, String deviceID);
  external useAudioDevice(dynamic localStream, String deviceID);
  external setSoundLevelDelegate(bool boolean, num interval);
  external isMicrophoneMuted();
  external muteMicrophone(bool mute);
  external enableMultiRoom(bool enable);
  external setLogConfig(dynamic config);
  external setDebugVerbose(bool enable);
  external getVersion();
  external renewToken(String token, String roomID);
  external setRoomExtraInfo(String roomID, String key, String value);
  external sendBarrageMessage(String roomID, String message);
  external sendBroadcastMessage(String roomID, String message);
  external sendCustomCommand(String roomID, String message, List toUserIDList);
  external on(String EventName, Object);
  external off(String EventName, Object);
}

@JS()
@anonymous
class MapOptions {
  external factory MapOptions({
    String userID,
    String userName,
  });

  external String get userID;
  external String get userName;
}

@JS()
@anonymous
class streamListInfo {
  external factory streamListInfo({
    String soundLevel,
    String streamID,
  });

  external String get userID;
  external String get userName;
}
